package com.sunkyc.framework.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sunkyc.commons.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * <p>
 * 角色信息表
 * </p>
 *
 * @author sunkyc
 * @since 2022-05-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_role")
@ApiModel(value="SysRole对象", description="角色信息表")
public class SysRole  extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "角色ID")
    @TableId(value = "role_id", type = IdType.ASSIGN_ID)
    private Long roleId;

    @ApiModelProperty(value = "角色名称")
    @NotBlank(message = "角色名称不能为空")
    private String roleName;

    @ApiModelProperty(value = "角色权限字符串")
    @NotBlank(message = "权限标识不能为空")
    private String roleKey;

    @ApiModelProperty(value = "显示顺序")
    private Integer roleSort;

    @ApiModelProperty(value = "数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）")
    private String dataScope;



    @ApiModelProperty(value = "角色状态（0正常 1停用）")
    private String state;

    @ApiModelProperty(value = "删除标志（0代表存在 2代表删除）")
    private String delFlag;


    @ApiModelProperty(value = "备注")
    private String remark;


    @ApiModelProperty(value = "角色对应的权限菜单id集合")
    @TableField(exist = false)
    private List<Long> perms;

    @ApiModelProperty(value = "角色对应的组织id的集合")
    @TableField(exist = false)
    private List<Long> deptIds;


}
